package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/2
 **/
public class CollectionToArray {
    public static void main(String[] args) {
        Collection<String> c=new ArrayList<>();
        c.add("one");
        c.add("one");
        c.add("one");
        c.add("one");
        c.add("one");
        System.out.println(c);
        String[] array=c.toArray(new String[5]);
        System.out.println(Arrays.toString(array));
    }
}
